package com.bw.demo_mvp;

import android.os.Bundle;
import android.view.View;

import androidx.annotation.Nullable;
import androidx.appcompat.app.AppCompatActivity;

import com.bw.demo_mvp.base.Basepres;

/**
 * @Author : ZhouZiYao
 * @Time : On 2023/11/16 20:32
 * @Description :
 */
public abstract class BaseActivity <V,P extends Basepres<V>>extends AppCompatActivity {
    protected P pres;

    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        bdbj();
        cshkj(savedInstanceState);
        cshsj();
        if(pres!=null){
            pres.aa((V)this);
        }
    }

    @Override
    protected void onDestroy() {
        super.onDestroy();
        if(pres!=null){
            pres.bb();
        }
    }

    @Override
    public <T extends View> T findViewById(int id) {
        return super.findViewById(id);
    }

    public abstract int bdbj();
    public abstract void cshkj(Bundle savedInstanceState);
    public abstract void cshsj();
}
